package com.engagesoft.cashflow.controlador;

import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ViewScoped;

import org.primefaces.event.CloseEvent;
import org.primefaces.event.DashboardReorderEvent;
import org.primefaces.event.ToggleEvent;
import org.primefaces.model.DashboardColumn;
import org.primefaces.model.DashboardModel;
import org.primefaces.model.DefaultDashboardColumn;
import org.primefaces.model.DefaultDashboardModel;

import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;

@ManagedBean(name = "dashController")
@ViewScoped
public class DashController implements Serializable {

    private DashboardModel model;

    @PostConstruct
    public void init() {
        model = new DefaultDashboardModel();
        DashboardColumn column1 = new DefaultDashboardColumn();
        DashboardColumn column2 = new DefaultDashboardColumn();
        DashboardColumn column3 = new DefaultDashboardColumn();

        column1.addWidget("clientes");
        column1.addWidget("conceptos");

        column2.addWidget("documentos");
        column2.addWidget("roles");

        column3.addWidget("sucursales");
        column3.addWidget("usuarios");

        model.addColumn(column1);
        model.addColumn(column2);
        model.addColumn(column3);
    }

    public DashboardModel getModel() {
        return model;
    }
}
